home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / ole2book.zip / CHAP06.ZIP / CHAP06 / FREELOAD / FREELOAD.H < prev    next >
C/C++ Source or Header  |  1993-05-19  |  3KB  |  114 lines

  1. /*
  2.  * FREELOAD.H
  3.  *
  4.  * Class overrides for the FreeLoader application
  5.  *
  6.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  7.  *
  8.  * Kraig Brockschmidt, Software Design Engineer
  9.  * Microsoft Systems Developer Relations
  10.  *
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14.  
  15.  
  16. #ifndef _FREELOAD_H_
  17. #define _FREELOAD_H_
  18.  
  19. #include <windows.h>
  20. #include <ole2.h>
  21. #include <ole2ver.h>
  22. #include <bookguid.h>
  23.  
  24.  
  25. //These include files reference DLLs that don't have extern "C" already
  26. extern "C"
  27.     {
  28.     #include <commdlg.h>
  29.     }
  30.  
  31. #include <classlib.h>
  32.  
  33.  
  34.  
  35. //FREELOAD.CPP:  Frame object that creates a main window
  36.  
  37. class __far CFreeloaderFrame : public CFrame
  38.     {
  39.     private:
  40.         BOOL            m_fInitialized;     //OleInitialize work?
  41.  
  42.     protected:
  43.         //Overridable for creating a CClient for this frame
  44.         virtual LPCClient CreateCClient(void);
  45.  
  46.     public:
  47.         CFreeloaderFrame(HINSTANCE, HINSTANCE, LPSTR, int);
  48.         virtual ~CFreeloaderFrame(void);
  49.  
  50.         virtual BOOL FInit(LPFRAMEINIT);
  51.     };
  52.  
  53.  
  54. typedef CFreeloaderFrame FAR * LPCFreeloaderFrame;
  55.  
  56.  
  57.  
  58.  
  59.  
  60. //CLIENT.CPP
  61.  
  62. //Override to create CFreeloaderDoc
  63. class __far CFreeloaderClient : public CClient
  64.     {
  65.     protected:
  66.         //Overridable for creating a new CDocument
  67.         virtual LPCDocument CreateCDocument();
  68.  
  69.     public:
  70.         CFreeloaderClient(HINSTANCE);
  71.         virtual ~CFreeloaderClient(void);
  72.     };
  73.  
  74.  
  75. typedef CFreeloaderClient FAR * LPCFreeloaderClient;
  76.  
  77.  
  78.  
  79.  
  80. //DOCUMENT.CPP
  81.  
  82. //Override file and clipboard operations as well as painting.
  83. class __far CFreeloaderDoc : public CDocument
  84.     {
  85.     protected:
  86.         LPSTORAGE           m_pIStorage;        //Root storage for this doc
  87.         LPUNKNOWN           m_pIUnknown;        //Static visual object.
  88.         DWORD               m_dwConn;           //From IOleCache::Cache
  89.  
  90.     protected:
  91.         //Centralized cleanup
  92.         void ReleaseObject(void);
  93.  
  94.         //To catch WM_PAINT
  95.         virtual BOOL    FMessageHook(HWND, UINT, WPARAM, LPARAM, LRESULT FAR *);
  96.  
  97.     public:
  98.         CFreeloaderDoc(HINSTANCE);
  99.         virtual ~CFreeloaderDoc(void);
  100.  
  101.         virtual UINT     ULoad(BOOL, LPSTR);
  102.         virtual UINT     USave(UINT, LPSTR);
  103.  
  104.         virtual BOOL     FClip(HWND, BOOL);
  105.         virtual HGLOBAL  RenderFormat(UINT);
  106.         virtual BOOL     FQueryPaste(void);
  107.         virtual BOOL     FPaste(HWND);
  108.     };
  109.  
  110. typedef CFreeloaderDoc FAR * LPCFreeloaderDoc;
  111.  
  112.  
  113. #endif //_FREELOAD_H_
  114.